<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <h3>{{ exampleText }}</h3>
    <button
      class="ctrl-btn"
      @click="exampleText=clicked?'我是测试用的文本':'点击了按钮';clicked=!clicked;"
    >{{clicked?'还原':'点我弹出提示'}}</button>
  </div>
</template>

<script>
export default {
  name: 'TestExample',
  data() {
    return {
      exampleText: '我是测试用的文本',
      clicked: false // 是否点击了按钮
    };
  },
  props: {
    msg: String
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
